<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        class Phone{


            //静态
            static cpu = '8 gen 3'
            static gpu = '2k 144hz'

            static show(){
                console.log("i can 显示彩色页面")
            }




            constructor(brand,price){
                //构造器
                this.brand = brand;
                this.price = price;
            }

            //setter 和 getter
            getBrand(){
                return this.brand
            }


            setBrand(brand){
                this.brand = brand
            }


            call(){
                console.log('i can 打电话')
            }
        }
        let onPluse = new Phone('1+',1999)
        onPluse.call()
        console.log(onPluse)
        //静态方法
        Phone.show()

        //静态属性
        console.log(Phone.cpu)




        //继承
        class SmartPhone extends Phone(){
            constructor(brand,price,size,color){
                super()
                this.size = size
                this.color = color
            }
            //重写
            call(){
                console.log('子类打电话 ')
            }
        }














    </script>
    
</body>
</html>